from django.db import models

# Create your models here.
class BookInfo(models.Model):
    # id 省略

    # 书籍名称
    name = models.CharField(max_length=10)

    def __str__(self):
        return self.name

class PeopleInfo(models.Model):
    # id 省略

    # 姓名
    name = models.CharField(max_length=10)
    # 性别
    gender = models.BooleanField()
    # 书籍对象
    book = models.ForeignKey(BookInfo,on_delete=models.CASCADE)

    def __str__(self):
        return self.name